﻿using Omabar.BLL;
using Omabar.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Omabar.CMS.CMS
{
    public partial class HotelEdit : System.Web.UI.Page
    {
        protected HOTEL hotel;
        protected string hotelid;
        protected List<PHOTO> photos;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Hotel_BLL bll = new Hotel_BLL();
                Photo_BLL photoBLL = new Photo_BLL();

                hotelid = Request["id"];
                hotel = bll.GetModel(hotelid);
                if (hotel == null) hotel = new HOTEL();

                //图库
                photos = photoBLL.GetModels(string.Format("SELECT TOP 10 T.PHOTO_ID,PHOTO_NAME,PHOTO_URL,PHOTO_DES,PHOTO_HOT,PHOTO_COVER FROM HOTEL_GALLERY T LEFT JOIN PHOTO V ON T.PHOTO_ID=V.PHOTO_ID WHERE T.HOTEL_ID='{0}'", hotelid));
                if (photos == null) photos = new List<PHOTO>();
                
            }
        }
    }
}